import 'dart:convert';
import 'dart:developer';

import 'package:fluro/fluro.dart';
import 'package:flutter/material.dart';
import 'package:flutter_dwh5/login/login.dart';
import 'package:flutter_dwh5/pages/home/classification.dart';
import 'package:flutter_dwh5/pages/home/goodsDetail/goodsDetail.dart';
import 'package:flutter_dwh5/pages/home/goodsDetail/pay/pay.dart';
import 'package:flutter_dwh5/pages/home/goodsDetail/pay/paySuccess.dart';
import 'package:flutter_dwh5/pages/home/goodsDetail/settlement/settlement.dart';
import 'package:flutter_dwh5/pages/index/index.dart';
import 'package:flutter_dwh5/pages/my/address/Add.dart';
import 'package:flutter_dwh5/pages/my/address/address.dart';
import 'package:flutter_dwh5/pages/my/edit/edit.dart';
import 'package:flutter_dwh5/pages/my/evaluate/evaluate.dart';
import 'package:flutter_dwh5/pages/my/my.dart';
import 'package:flutter_dwh5/pages/my/order/Logistics.dart';
import 'package:flutter_dwh5/pages/my/order/order.dart';
import 'package:flutter_dwh5/pages/my/proposal/proposal.dart';
import 'package:flutter_dwh5/pages/my/setting/setting.dart';
import 'package:flutter_dwh5/register/register.dart';
import 'package:flutter_dwh5/setPsd/setPsd.dart';

class Routes {
  static FluroRouter router = FluroRouter();
  //定义路由名称
  static String index = '/';
  static String login = '/login';
  static String register = '/register';
  static String setpsd = '/setpsd';
  static String classification = '/classification'; //分类
  static String goodsDetail = '/goodsDetail'; //商品详情
  static String proposal = '/proposal'; //投诉建议
  static String setting = '/setting'; //设置
  static String evaluate = '/evaluate'; //评价
  static String address = '/address'; //收货地址Settlement
  static String add = '/add'; //新增收货地址
  static String settlement = '/settlement'; //结算
  static String pay = '/pay'; //支付
  static String paySuccess = '/paySuccess'; //支付成功
  static String order = '/order'; //我的订单
  static String logistics = '/logistics'; //跟踪物流
  static String my = '/my'; //我的
  static String edit = '/edit'; //个人资料
  //定义路由处理函数
  static var _indexHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return Index();
  });
  static var _loginHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return Login();
  });
  static var _registerHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return Register();
  });
  static var _setpsdHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return SetPsd();
  });
  static var _classificationHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return ClassifiCation();
  });
  static var _goodsDetailHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return GoodsDetail();
  });
  static var _proposalHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return Proposal();
  });
  static var _settingHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return Setting();
  });
  static var _evaluateHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return Evaluate();
  });
  static var _addressHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return Address();
  });
  static var _addHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return Add();
  });
  static var _settlementHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return Settlement();
  });
  static var _payHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return Pay();
  });
  static var _paySuccessHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return PaySuccess();
  });
  static var _orderHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return Order();
  });
  static var _logisticsHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return Logistics();
  });
  static var _myHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return My();
  });
  static var _editHandler =
      Handler(handlerFunc: (BuildContext context, Map<String, dynamic> params) {
    return Edit();
  });
  static void configureRoutes(FluroRouter router) {
    router.define(login, handler: _loginHandler);
    router.define(register, handler: _registerHandler);
    router.define(setpsd, handler: _setpsdHandler);
    router.define(index, handler: _indexHandler);
    router.define(classification, handler: _classificationHandler);
    router.define(goodsDetail, handler: _goodsDetailHandler);
    router.define(proposal, handler: _proposalHandler);
    router.define(setting, handler: _settingHandler);
    router.define(evaluate, handler: _evaluateHandler);
    router.define(address, handler: _addressHandler);
    router.define(add, handler: _addHandler);
    router.define(settlement, handler: _settlementHandler);
    router.define(pay, handler: _payHandler);
    router.define(paySuccess, handler: _paySuccessHandler);
    router.define(order, handler: _orderHandler);
    router.define(logistics, handler: _logisticsHandler);
    router.define(my, handler: _myHandler);
    router.define(edit, handler: _editHandler);
    // router.notFoundHandler = _NotFoundHandler;
  }
}
